Repository navigation
Kibana service: published through a Domain (S-024-8) - #610
Conversation
A Kibana service that declares kibana.domain was refused by the role until this issue. services.yml now hands the cloudfall_kibana role the Domain from the server's own Domains (validation already requires the Domain's proxy server to be the Kibana server), and the role writes server.publicBaseUrl: https://<primaryName> and xpack.security.secureCookies: true, so the links Kibana generates use the public address and its session cookie travels over HTTPS only. Kibana keeps listening on loopback. The certificate and the nginx site in front of it stay the existing Domain apply path (domains.yml and cloudfall_nginx_site); no second nginx or TLS mechanism. The role now refuses, before any change, a domain its server does not hold proxying to the Kibana port with tls.mode required and no routes. An undomained Kibana renders the same kibana.yml as before. Fixes #573 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Review: MERGE at 36abe0b. Reviewed 0821d58; one fix commit since, 36abe0b, which drops the stale "a declared domain is refused" clause from changelog.d/569-kibana-converge.md (was F-1).
Checks: ruff, mypy, ansible-lint (CI config) clean; touched tests 23 passed. specs.py coverage --spec 024 lists four tests for S-024-8; its exit 1 is for criteria other issues build.
Verified: Kibana stays on loopback; server.publicBaseUrl is exactly https://<primaryName>; secureCookies only with a domain, an undomained kibana.yml unchanged. The existing domain-site.conf.j2 sends Host and X-Forwarded-Proto, proxies to the Domain's upstream, and redirects plain HTTP. The role's refusals are a subset of config validate's, so validate never accepts what converge refuses. The rewritten S-024-4 test still proves every refusal precedes the first change. Not checking that the Domain was applied is in line with the spec, which makes the applied Domain a precondition of S-024-8.
Unverified live: a login through the domain, the certificate, the Secure cookie in a browser, generated links (rendered config only).
Notes (not blocking):
- F-2 (nit): the S-024-8 tests check rendered settings only (Q-1); the PR says so
History: H-1 consistent; the rest unrelated; #611 and #597 also edit services.yml.
Plan
engine/ansible/roles/cloudfall_kibana/tasks/main.yml,engine/ansible/roles/cloudfall_kibana/templates/kibana.yml.j2,engine/ansible/roles/cloudfall_kibana/defaults/main.yml,engine/ansible/roles/cloudfall_kibana/meta/argument_specs.yml,engine/ansible/playbooks/services.yml,engine/tests/test_s024_kibana_role.py,engine/tests/test_s024_8_kibana_domain.py(new),changelog.d/573-kibana-domain.mdkibana.domainnames, from the server's owncloudfall_domains(the Domain's proxy server is the Kibana server, which validation already requires); the role replaces its refusal of a declareddomainwith a refusal of a Domain the server does not hold, before any change;kibana.ymlgetsserver.publicBaseUrl: https://<primaryName>andxpack.security.secureCookies: truefor a published Kibana, and stays as it is withoutdomain; the certificate and the nginx site in front of the loopback listener stay the existing Domain apply path (domains.yml,cloudfall_nginx_site), with no second mechanismtest_s024_8_...in a newengine/tests/test_s024_8_kibana_domain.py, kept apart from the role's test file that Kibana service: view and edit access for declared users (S-024-6, S-024-7) #572 also edits: the renderedkibana.ymlof a published Kibana, the Domain services.yml hands the role, the refusal of a Domain the server does not hold, and the spec's Domain rendered bycloudfall_nginx_sitein front of the loopback listener with the certificate of its name); the existing S-024-3 test keeps the undomainedkibana.ymlunchangedengine/tests/test_s024_kibana_role.py: its S-024-4 test asserted the refusal of a declareddomain, which this issue liftsSummary
Publishes a Kibana service through the existing
Domainitskibana.domainnames (S-024-8). #598 refused a declareddomainin the role; this lifts that refusal.services.ymlhandscloudfall_kibanaa newcloudfall_kibana_domain: the Domain of that id among the server's owncloudfall_domains(the Domain's proxy server is the Kibana server, whichconfig validatealready requires withservice_kibana_domain)kibana.ymlof a published Kibana getsserver.publicBaseUrl: "https://<primaryName>"(no trailing slash) andxpack.security.secureCookies: true. Withoutdomainthe file is byte-for-byte what it wascloudfall domains apply->domains.yml->cloudfall_nginx_site), whose site already proxies withHostandX-Forwarded-Proto. No second nginx or TLS mechanismRefuse a Domain this server does not hold for Kibana(still before any task that changes the host) stops a converge whose Domain is not on the server, not proxying to the Kibana port, nottls.mode: required, or hasroutes: a guard behind validation, not a new ruleresource_reference_missing, from Kibana service: declaration and validation (S-024-1, S-024-2, S-024-12) #567)Test notes
uv run pytest engine/tests/test_s024_8_kibana_domain.py engine/tests/test_s024_kibana_role.py: 23 passeduv run ruff check .,uv run mypy,ANSIBLE_CONFIG=engine/ansible/ansible.cfg uv run ansible-lint engine/ansible: cleanspecs.py coverage --spec 024lists four S-024-8 testsconvergejobhttps://kibana.example.testwith a real certificate, theSecureflag on Kibana'ssidcookie as the browser sees it, and generated links (share URLs) starting with the public address. The tests prove the settings Kibana is given and the nginx site rendered in front of it, not Kibana's answersFixes #573
🤖 Generated with Claude Code